<?php if (!defined('THINK_PATH')) exit();?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no" />
    <title>我的订单-老师上门</title>
    <link rel="stylesheet" href="/lssm/Public/mobile/css/public.css">
    <link rel="stylesheet" href="/lssm/Public/mobile/css/fenlei.css">
    <link rel="stylesheet" href="/lssm/Public/mobile/css/index.css">
    <link rel="stylesheet" href="/lssm/Public/mobile/css/user.css">

    <link href="/lssm/Public/css/layui.css" rel="stylesheet" type="text/css" media="all"/>
    <script type="text/javascript" src="/lssm/Public/layui.js"></script>

    <script type="text/javascript" src="/lssm/Public/mobile/js/jquery-1.8.3.min.js"></script>

</head>
<body>
<div id="page" class="showpage">
    <!-- 顶部导航及筛选start -->
    <header>
      <div class="tab_nav">
        <div class="header">
          <div class="h-left"><a class="sb-back" href="javascript:history.back(-1)" title="返回"></a></div>
          <div class="h-mid">课程签到</div>
        </div>
      </div>
      </header>
    <!-- 顶部导航及筛选end -->
    <!-- 老师列表start -->
    <section class="hots bortn"> 
       <div class="ui-refresh"> 
        <div id="data-list">
        <?php foreach ($signs as $v) { ?>
          <dl style="padding: 0px 8px;">
           <dd class="dd-l"> 
              <strong class="t-name">授课时间：<?php echo date('Y-m-d H:i',$v['addtime']) ?><i></i></strong>
              <!-- <span class="t-pingjia">课时：<?php echo ($v["keshi"]); ?></span> -->
              <p class="t-tag">授课课时：<?php echo ($v["keshi"]); ?></p>
              <p class="t-tag">老师总结：<?php echo ($v["zongjie"]); ?></p>
              <p class="t-tag">家长评论：</p>
              <div style="position: relative;left: 60px;top: -18px;"><textarea class='comm' cols="15" rows="4" placeholder="请家长对本次授课作出精简评论" style="width: 60%;border: 0px;background: #c1b7b7;"><?php echo ($v["comment"]); ?></textarea></div>
              <p class="t-pingjia" style="bottom: 25px;right: 5px;"><!--  right: 5px;top: 1px;-->
                <?php if ($v['jz_qd'] == 1) { ?>
                    <span class="layui-btn" style="background: #ccc;">已签</span>
                <?php }else { ?>
                    <span  class="layui-btn" onclick="ls_tongz(this,'<?php echo ($v["id"]); ?>')" style="background: #30C76C;">签到</span>
                <?php } ?>
              </p>
           </dd>                                                    
          </dl> 
        <?php } ?>      
        </div> 
       </div> 
    </section>
    <!-- 老师列表end -->

</div>
    <script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form()
          ,layer = layui.layer;
    
        });

        /*评论通知*/
        function ls_tongz(obj,id){
            layer.confirm('确认要提交吗？',function(index){
                //发异步删除数据
                var comm = $(obj).parents('dd').find('.comm').val();//获取评论
                $.ajax({
                    url: "<?php echo U('mobile/info/qiandaosl');?>",//请求地址
                    type: "post",//请求方式
                    dataType: "json",//返回数据类型
                    data: {id:id,comm:comm},//发送的参数
                    })
                    .done(function(response) {
                          if(response.error==1){
                            layer.msg(response.info ,{icon:6});
                            location.reload();
                          }else{
                            layer.msg(response.info ,{icon:5});
                          }
                      })
                    .fail(function() {
                        alert("ajxs交互失败");
                    })  
                return false;
            });
        }
    </script>
</body>
</html>